home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Assembly / Mac68k / MANUAL / MAN7.DOC < prev    next >
Encoding:
Text File  |  1985-08-11  |  14.6 KB  |  518 lines  |  [TEXT/Anon]

  1.  
  2. MAC.68K
  3.  
  4.  
  5.  
  6.                                  IF                                 IF                                 IF
  7.  
  8.  
  9.  
  10.   PURPOSE         To conditionally assemble or skip source lines based
  11.                on an attribute test.
  12.  
  13.  
  14.  
  15.   FORMAT     IF   attribute,expression
  16.              IF  -attribute,expression
  17.      ifname  IF   attribute,expression
  18.      ifname  IF  -attribute,expression
  19.              IF   attribute,expression,lcnt
  20.              IF  -attribute,expression,lcnt
  21.      ifname  IF   attribute,expression,lcnt
  22.      ifname  IF  -attribute,expression,lcnt
  23.  
  24.       attribute            TRUE if
  25.  
  26.        DEF            All symbols in expression are defined.
  27.        AREG           Expression is an address register direct.
  28.        DREG           Expression is a data register direct.
  29.        IREG           Expression is an indirect register reference.
  30.        ABS            Expression is an absolute memory reference.
  31.        PREL           Expression is a program relative reference.
  32.        SREG           Expression is a status register.
  33.        IMMD           Expression is immediate data.
  34.  
  35.  
  36.  
  37.   DESCRIPTION     IF tests an expression for an attribute and begins
  38.                assembling the IF block if the test is true, or begins
  39.                skipping if the test is not true.  By using a - prefix
  40.                on the attribute type, the effect of the test is
  41.                reversed.
  42.  
  43.                    The IF block is either bounded by ELSE/ENDC pseudo
  44.                op codes, or is a specified line count in length. If
  45.                the line count parameter lcnt is used, the following
  46.                source lines are skipped until either the count is
  47.                exhausted, or until an unnamed ELSE or a named ELSE
  48.                with a matching ifname is found.  If a count is not
  49.                specified, the IF block is terminated by an unnamed
  50.                ENDC or a matching named ENDC. Within the block the
  51.                effects of the test may be reversed by an unnamed ELSE
  52.                or an ELSE with a matching ifname.
  53.  
  54.                    By using named IF blocks, a virtually unlimited
  55.                amount of conditional nesting may occur.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                               -37-                              MAC.68K
  64.                                                                 MAC.68K
  65.  
  66.  
  67.                                 IFS / IFC                                IFS / IFC                                IFS / IFC
  68.  
  69.  
  70.   PURPOSE         To conditionally skip or assemble source lines based
  71.                on string comparisons.
  72.  
  73.  
  74.   FORMAT               IFS    comparision,dstring1dstring2d
  75.                        IFS    comparision,dstring1dstring2d,lcnt
  76.              ifname    IFS    comparision,dstring1dstring2d
  77.              ifname    IFS    comparision,dstring1dstring2d,lcnt
  78.  
  79.               comparison       EQ  NE  GE  GT  LE  LT
  80.  
  81.               d                String delimiter character. Any character
  82.                                not occuring in string 1 or in string 2
  83.                                except for & or ".
  84.  
  85.               string           Character strings to compare
  86.  
  87.               lcnt             Optional source line skip count
  88.  
  89.  
  90.   DESCRIPTION     IFS compares two strings and begins assembly if the
  91.                comparison is true, or begins skipping source lines if
  92.                the comparison is false. The comparison is done left
  93.                to right until the condition is found false or the
  94.                strings are exhausted. A short string is logically
  95.                padded with null characters.
  96.  
  97.                    The IF block is either bounded by ELSE/ENDC pseudo
  98.                op codes, or is a specified line count in length. If
  99.                the line count parameter lcnt is used, the following
  100.                source lines are skipped until either the count is
  101.                exhausted, or until an unnamed ELSE or a named ELSE
  102.                with a matching ifname is found.  If a count is not
  103.                specified, the IF block is terminated by an unnamed
  104.                ENDC or a matching named ENDC. Within the block the
  105.                effects of the test may be reversed by an unnamed ELSE
  106.                or an ELSE with a matching ifname.
  107.  
  108.                    By using named IF blocks, a virtually unlimited
  109.                amount of conditional nesting may occur.
  110.  
  111.                    The pseudo ops IFC and IFNC are recognized and
  112.                processed as the equivalent IFS pseudo ops. Their
  113.                format is the same as described by AS68.
  114.  
  115.   EXAMPLE    RETURN    MACRO   ADDR
  116.                        IFS     EQ,*ADDR**       TEST FOR NULL PARAMETER
  117.                        RTS
  118.                        ELSE
  119.                        BRA     ADDR
  120.                        ENDC
  121.                        ENDM
  122.  
  123.  
  124.  
  125. MAC.68K                                  -38-
  126. MAC.68K
  127.  
  128.  
  129.                                 IFxx                                IFxx                                IFxx
  130.  
  131.  
  132.  
  133.   PURPOSE         To conditionally assemble or skip source lines based
  134.                on a comparison of two expressions.
  135.  
  136.  
  137.  
  138.   FORMAT               IFxx   expression1
  139.                        IFxx   expression1,expression2
  140.                        IFxx   expression1,expression2,lcnt
  141.              ifname    IFxx   expression1,expression2
  142.              ifname    IFxx   expression1,expression2,lcnt
  143.  
  144.                    xx           EQ  NE  GE  GT  LE  LT
  145.  
  146.                    lcnt         Optional source line skip count.
  147.  
  148.  
  149.  
  150.   DESCRIPTION     IFxx compares two expressions and begins assembly
  151.                if the xx condition is true, or begins skipping if the
  152.                xx condition is false.  If expression2 is not present,
  153.                expression1 is compared to zero.  Any symbols used in
  154.                the expressions must be previously defined.
  155.  
  156.                    The IF block is either bounded by ELSE/ENDC pseudo
  157.                op codes, or is a specified line count in length. If
  158.                the line count parameter lcnt is used, the following
  159.                source lines are skipped or assembled until either the
  160.                count is exhausted, or until an unnamed ELSE or a
  161.                named ELSE with a matching ifname is found.  If a
  162.                count is not specified, the IF block is terminated by
  163.                an unnamed ENDC or a matching named ENDC. Within the
  164.                block the effects of the test may be reversed by an
  165.                unnamed ELSE or an ELSE with a matching ifname.
  166.  
  167.                    By using named IF blocks, a virtually unlimited
  168.                amount of conditional nesting may occur.
  169.  
  170.  
  171.  
  172.   EXAMPLES             IFGT    PAGSIZE,24
  173.                        BSR     ADVANP
  174.                        ELSE
  175.                        BSR     ADVANL
  176.                 FOO    IFLE    BAZ,BAZLIMIT,3
  177.                        BSR     SETBAZ
  178.                 FOO    ENDC
  179.                        ENDC
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                               -39-                              MAC.68K
  188.                                                                 MAC.68K
  189.  
  190.  
  191.                               INCLUDE                              INCLUDE                              INCLUDE
  192.  
  193.  
  194.  
  195.   PURPOSE         To insert text from another file into the assembly.
  196.  
  197.  
  198.  
  199.   FORMAT               INCLUDE  filename
  200.  
  201.  
  202.  
  203.   DESCRIPTION     INCLUDE reads in all the text from the specified
  204.                file name and MAC.68K then assembles that text before
  205.                resuming assembly with the next line of input. INCLUDE
  206.                may be nested to 5 levels.
  207.  
  208.                    MAC.68K uses a default extension of blanks.
  209.  
  210.  
  211.  
  212.   EXAMPLES             INCLUDE  IODECKS.TXT
  213.                        INCLUDE  B:IODECKS
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. MAC.68K                                  -40-
  250. MAC.68K
  251.  
  252.  
  253.                               INCLUDEH                              INCLUDEH                              INCLUDEH
  254.  
  255.  
  256.  
  257.   PURPOSE         To load a previously assembled object module.
  258.  
  259.  
  260.  
  261.   FORMAT               INCLUDEH  filename
  262.  
  263.  
  264.  
  265.   DESCRIPTION     INCLUDEH reads in a previously assembled .MOD
  266.                file.  MAC.68K adds the current value of the location
  267.                counter to any entry point symbol values from the .MOD
  268.                file and enters the symbol names in the symbol table.
  269.                MAC.68K then inserts the object code from the .MOD
  270.                file at the current origin counter and advances the
  271.                origin and location counters by the length of the
  272.                object code.
  273.  
  274.                    MAC.68K uses a default extension of .MOD.
  275.  
  276.  
  277.  
  278.   EXAMPLE              INCLUDEH  RUNIO
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.                               -41-                              MAC.68K
  312.                                                                 MAC.68K
  313.  
  314.  
  315.                               INCLUDES                              INCLUDES                              INCLUDES
  316.  
  317.  
  318.  
  319.   PURPOSE         To load a previously assembled set of symbols and macro
  320.                definitions.
  321.  
  322.  
  323.  
  324.   FORMAT               INCLUDES  filename
  325.                        INCLUDES  filename,symbol,symbol,...symbol
  326.  
  327.  
  328.  
  329.   DESCRIPTION     INCLUDES is an initialization directive. It must
  330.                appear after the IDENT card but before any
  331.                non-initialization operation codes.
  332.  
  333.                    INCLUDES reads a previously assembled .STX file
  334.                and enters the symbols and macros from the .STX file
  335.                into the current symbol and macro tables.  A maximum
  336.                of three INCLUDES may be used in one assembly. In the
  337.                case of duplicate symbol or macro definitions, the
  338.                first one encountered is used.
  339.  
  340.                    MAC.68K uses a default extension of .STX .
  341.  
  342.                    A list of symbol names that are NOT to be defined
  343.                may appear after the filename. This allows the program
  344.                to define its own values for those symbols.
  345.  
  346.  
  347.  
  348.   EXAMPLES             INCLUDES  CPMTEXT
  349.                        INCLUDES  CPMTEXT,FCBL
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373. MAC.68K                                  -42-
  374. MAC.68K
  375.  
  376.  
  377.                                 LIST                                LIST                                LIST
  378.  
  379.  
  380.  
  381.   PURPOSE         To select which lines are written to the list file.
  382.  
  383.  
  384.  
  385.   FORMAT               LIST   option1,option2,...optionN
  386.  
  387.    Default      Option        Line type controlled by option
  388.  
  389.      -            A           Image prior to concatenation and string
  390.                               substitution.
  391.      -            C           Op codes: PAGE SPACE TITLE and SUBTTL.
  392.      -            D           DUPlicated lines.
  393.      -            E           DEFERed lines.
  394.      -            F           IF skipped lines.
  395.      -            G           M68000 instructions and data op codes.
  396.                               Overrides LIST options M and S.
  397.      -            I           Included text lines.
  398.      +            L           All source lines.
  399.      -            M           User macro expansions.
  400.      -            S           System macro expansions.
  401.                   $           All options.
  402.                   *           Reinstate options in effect prior to
  403.                               previous LIST.
  404.  
  405.  
  406.  
  407.   DESCRIPTION     LIST options are a single character or a single
  408.                character prefixed by a -. Multiple options separated
  409.                by commas may be used, and are scanned from left to
  410.                right. A single character enables the option and the -
  411.                prefix disables the option.
  412.  
  413.                    Line types are inclusive in nature and all LIST
  414.                options that apply must be selected before a source
  415.                line is listed. For example, to list an IF skipped
  416.                line within a user macro called in an included text
  417.                file requires options L,I,M,F to be enabled.
  418.  
  419.                    The prior list option is remembered and may be
  420.                restored by using LIST *.  LIST -$ will turn off all
  421.                options. LIST G is useful for listing macro
  422.                expansions.
  423.  
  424.  
  425.  
  426.   EXAMPLES             LIST    -L
  427.                        LIST    L,F,-M
  428.                        LIST    *
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.                               -43-                              MAC.68K
  436.                                                                 MAC.68K
  437.  
  438.  
  439.                                 LOC                                LOC                                LOC
  440.  
  441.  
  442.  
  443.   PURPOSE         To set the current location counter.
  444.  
  445.  
  446.  
  447.   FORMAT               LOC    expression
  448.  
  449.  
  450.  
  451.   DESCRIPTION     The location counter is used to assign address
  452.                values to location field symbols on M68000
  453.                instructions and data pseudo ops. It may be set
  454.                independent of the origin counter.
  455.  
  456.                    By default the location counter equals the origin
  457.                counter, and a new ORG will also automatically reset
  458.                the LOC counter. Caution is advised when changing the
  459.                LOC because code generated with mismatching ORG and
  460.                LOC values probably will not execute properly.
  461.  
  462.                    All symbols used in the expression to generate the
  463.                new LOC value must be previously defined.
  464.  
  465.                    The current value of the location counter may be
  466.                referenced by using the special symbols * or *L.
  467.  
  468.                    Often used to assemble blocks of code to be moved
  469.                at execution time from the ORGed address to the LOCed
  470.                address. Also used for assembly of table definitions
  471.                containing relative addresses (see also OFFSET).
  472.  
  473.  
  474.  
  475.   EXAMPLES             LOC   $FF0000
  476.                        LOC   *O       Reset LOC to current origin address
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497. MAC.68K                                  -44- eset LOC to current origin address
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518. MAC.68K